import Vue from 'vue'
import App from './App'

// vuex
import store from './store'

// 引入全局uView
import uView from '@/uni_modules/uview-ui'

import mixin from './common/mixin'
import * as apis from './common/api.js'
import moment from 'moment'
import {
	baseUrl
} from './common/config.js'
Vue.prototype.$store = store
Vue.prototype.$url = 'https://rtzzb.myntv.cn/xbh'
Vue.prototype.baseUrl = baseUrl
moment.locale('zh-cn')
Vue.prototype.moment = moment
Vue.prototype.getUrl = (url) => {
	if (url.indexOf('@') > -1) {
		let newUrl = url.replace('@', 'https://rtzzb.myntv.cn/xbh')
		return newUrl
	} else {
		return  'https://rtzzb.myntv.cn/' + url
	}
}
Vue.prototype.$api = apis
Vue.config.productionTip = false
App.mpType = 'app'
Vue.use(uView)

// #ifdef MP
// 引入uView对小程序分享的mixin封装
const mpShare = require('@/uni_modules/uview-ui/libs/mixin/mpShare.js')
Vue.mixin(mpShare)
// #endif

Vue.mixin(mixin)

const app = new Vue({
	store,
	...App
})

// 引入请求封装
require('./util/request/index')(app)

app.$mount()